

import React from 'react';
import css from './index.less';
import { observer } from 'mobx-react';
import PropTypes from 'prop-types';
import { Icon } from 'antd';



@observer
export default class VideoRender extends React.Component {

  constructor(props) {
    super(props);
    this.state = {

    };
  }

  static propTypes = {
    mod: PropTypes.object,
  };


  isDelete() {
    const { delArea = () => {}, ind } = this.props;
    delArea(ind);
  }
  mouseDown() {
    const { mouseDown = () => {}, ind} = this.props;
    mouseDown(ind);
  }


  render() {
    const { mod } = this.props;
    // console.log('mod.styleWrapper.src', mod.styleWrapper.autoPlay);

    const wrapperProps = {
      className: css.wrapper,
      style: mod.styleWrapper,
      onMouseDown: this.mouseDown.bind(this),
    };

    return (
      <video {...wrapperProps} controls loop autoPlay={ mod.styleWrapper.autoPlay}>
        <source src={mod.styleWrapper.src}/>
      </video>
    );
  }
}
